-- GENERATED SPELL FOR [Wyrm Reanimator] --


function spell0_31731(pUnit, Event) --@Corruption,n/a--
pUnit:FullCastSpellOnTarget(32063,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31731', 26000, 1)
end

function spell1_31731(pUnit, Event) --@Cripple,n/a--
pUnit:FullCastSpellOnTarget(11443,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31731', 18000, 1)
end

function spell2_31731(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31731', 3000, 1)
end

function Sorts_31731(pUnit, Event)
local choix_sorts_31731 = math.random(0, 2)
if choix_sorts_31731 == 0 then
pUnit:RegisterEvent('spell0_31731', 1, 1)
end
if choix_sorts_31731 == 1 then
pUnit:RegisterEvent('spell1_31731', 1, 1)
end
if choix_sorts_31731 == 2 then
pUnit:RegisterEvent('spell2_31731', 1, 1)
end
end

function mob31731_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31731', math.random(1500, 3000), 1)
end

function mob31731_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31731_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31731_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31731, 1, 'mob31731_Action')
RegisterUnitEvent(31731, 2, 'mob31731_Leave')
RegisterUnitEvent(31731, 3, 'mob31731_Kill')
RegisterUnitEvent(31731, 4, 'mob31731_Die')
